﻿//===============================================================================
// Microsoft Innovation Centre - Western Europe
// Copyright (c) 2008 Microsoft Corporation. All rights reserved.
//
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY
// OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT
// LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
// FITNESS FOR A PARTICULAR PURPOSE.
//===============================================================================
// The example companies, organizations, products, domain names,
// e-mail addresses, logos, people, places, and events depicted
// herein are fictitious.  No association with any real company,
// organization, product, domain name, email address, logo, person,
// places, or events is intended or should be inferred.
//===============================================================================

namespace Microsoft.WVB.Framework
{
    /// <summary>
    /// The Interface that any Membership Provider needs to adhere.
    /// </summary>
    /// <remarks>Note that Membership only refers to Authentication. For Profile and Authorization, refer to <see cref="IProfileProvider"/> interface.</remarks>
    /// <typeparam name="T">A <see cref="IMembershipUser"/> implementation class.</typeparam>
    public interface IMembershipProvider<T> where T: class, IMembershipUser
    {
        event GetUserEventHandler<T> GetUserCompleted;
        void GetUserAsync(string username, object userData);
        void GetUserAsync(string username);
       
        event CreateUserEventHandler<T> CreateUserCompleted;
        void CreateUserAsync(string username, string password, string email, object userData);
        void CreateUserAsync(string username, string password, string email);
        
        event System.EventHandler<NotifyActionCompletedEventArgs> DeleteUserCompleted;
        void DeleteUserAsync(string username, object userData);
        void DeleteUserAsync(string username);
        
        event System.EventHandler<NotifyActionCompletedEventArgs> UpdateUserCompleted;
        void UpdateUserAsync(T user, object userData);
        void UpdateUserAsync(T user);
        
        event System.EventHandler<NotifyActionCompletedEventArgs> ValidateUserCompleted;
        void ValidateUserAsync(string username, string password, object userData);
        void ValidateUserAsync(string username, string password);
        
        event System.EventHandler<NotifyActionCompletedEventArgs> ChangePasswordCompleted;
        void ChangePasswordAsync(string username, string oldpassword, string newpassword, object userData);
        void ChangePasswordAsync(string username, string oldpassword, string newpassword);

        void CancelAsync();

    }
}
